home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.FontMetrics;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.net.URL;
-
- public class magic_textscroll extends Applet implements Runnable {
- // $FF: renamed from: ru java.lang.Thread
- Thread field_0;
- // $FF: renamed from: tx java.lang.String[]
- String[] field_1;
- // $FF: renamed from: di java.lang.String[]
- String[] field_2;
- // $FF: renamed from: cy java.awt.Color[]
- Color[] field_3;
- // $FF: renamed from: yc int[]
- int[] field_4;
- // $FF: renamed from: nf java.awt.Font[]
- Font[] field_5;
- int[] txth;
- int[] aralik;
- int[] descdata;
- // $FF: renamed from: wp int[]
- int[] field_6;
- int[] controld;
- int[] animation_step;
- // $FF: renamed from: og java.awt.Graphics
- Graphics field_7;
- Image img;
- // $FF: renamed from: ge int
- int field_8;
- // $FF: renamed from: yu int
- int field_9;
- int text_count;
- // $FF: renamed from: d int
- int field_10;
- // $FF: renamed from: X int[]
- int[] field_11;
- int[] mesajgenisligi;
- FontMetrics fmetrics;
- boolean ilk = true;
- Color bgc;
- long hiz;
- String link1 = "";
- String infostr = "";
- String target_frame = "";
- String regcode = "";
- // $FF: renamed from: u java.net.URL
- URL field_12;
- int bgcolor;
- int fgcolor;
- // $FF: renamed from: rg boolean
- boolean field_13 = false;
- boolean whb = false;
-
- public void init() {
- this.field_8 = -1;
- this.field_9 = -1;
- this.whb = false;
- String var1 = "";
- var1 = ((Applet)this).getParameter("bgcolor");
-
- try {
- this.bgcolor = Integer.parseInt(var1, 16);
- } catch (Exception var3) {
- this.bgcolor = 0;
- }
-
- this.bgc = new Color(this.bgcolor);
- ((Component)this).setBackground(this.bgc);
- this.regcode = ((Applet)this).getParameter("regcode");
- if (this.regcode != null && this.regcode.equals("mtxscr34")) {
- this.field_13 = true;
- }
-
- try {
- this.text_count = Integer.parseInt(((Applet)this).getParameter("text_count"), 10);
- } catch (Exception var2) {
- this.text_count = 0;
- }
-
- this.infostr = ((Applet)this).getParameter("info");
- this.hiz = Long.valueOf(((Applet)this).getParameter("delay_time"));
- this.field_1 = new String[this.text_count + 1];
- this.field_2 = new String[this.text_count + 1];
- this.field_3 = new Color[this.text_count + 1];
- this.field_4 = new int[this.text_count + 1];
- this.field_5 = new Font[this.text_count + 1];
- this.mesajgenisligi = new int[this.text_count + 1];
- this.txth = new int[this.text_count + 1];
- this.aralik = new int[this.text_count + 1];
- this.descdata = new int[this.text_count + 1];
- this.descdata = new int[this.text_count + 1];
- this.field_11 = new int[this.text_count + 1];
- this.field_6 = new int[this.text_count + 1];
- this.controld = new int[this.text_count + 1];
- this.animation_step = new int[this.text_count + 1];
- this.link1 = ((Applet)this).getParameter("link");
- this.target_frame = ((Applet)this).getParameter("target_frame");
- }
-
- public boolean mouseEnter(Event var1, int var2, int var3) {
- if (this.whb) {
- this.stop();
- if (this.link1 == null) {
- return true;
- }
-
- if (this.link1.equals("") || this.link1.equals(" ")) {
- return true;
- }
-
- ((Frame)((Component)this).getParent()).setCursor(12);
- if (this.field_13) {
- ((Applet)this).showStatus("" + this.link1);
- } else {
- ((Applet)this).showStatus(" Unregistered version of Magic Textscroll Java applet. URL: japplets.tripod.com");
- }
- }
-
- return true;
- }
-
- public boolean mouseExit(Event var1, int var2, int var3) {
- if (this.whb) {
- ((Applet)this).showStatus("");
- this.start();
- ((Frame)((Component)this).getParent()).setCursor(0);
- }
-
- return true;
- }
-
- public boolean mouseDown(Event var1, int var2, int var3) {
- if (this.whb) {
- try {
- this.field_12 = new URL("" + this.link1);
- ((Applet)this).getAppletContext().showDocument(this.field_12, this.target_frame);
- } catch (Exception var4) {
- return true;
- }
- }
-
- return true;
- }
-
- public void update(Graphics var1) {
- if (this.whb) {
- this.field_7.setColor(this.bgc);
- this.field_7.fillRect(0, 0, this.field_8, this.field_9);
-
- for(this.field_10 = 1; this.field_10 <= this.text_count; ++this.field_10) {
- this.field_7.setFont(this.field_5[this.field_10]);
- this.field_7.setColor(this.field_3[this.field_10]);
- this.field_7.drawString(this.field_1[this.field_10], this.field_11[this.field_10], this.txth[this.field_10] + this.aralik[this.field_10] - this.descdata[this.field_10]);
- int var10002 = this.controld[this.field_10]++;
- if (this.controld[this.field_10] > this.field_6[this.field_10]) {
- this.controld[this.field_10] = 1;
- if (this.field_2[this.field_10].equals("true")) {
- this.field_11[this.field_10] -= this.animation_step[this.field_10];
- if (this.field_11[this.field_10] < -this.mesajgenisligi[this.field_10]) {
- this.field_11[this.field_10] = this.field_8;
- }
- } else {
- this.field_11[this.field_10] += this.animation_step[this.field_10];
- if (this.field_11[this.field_10] > this.field_8) {
- this.field_11[this.field_10] = -1 * this.mesajgenisligi[this.field_10];
- }
- }
- }
- }
-
- this.paint(var1);
- }
-
- }
-
- public void paint(Graphics var1) {
- if (this.whb) {
- var1.drawImage(this.img, 0, 0, this);
- }
-
- }
-
- public void start() {
- if (this.field_0 == null) {
- this.field_0 = new Thread(this);
- this.field_0.start();
- }
-
- }
-
- public void stop() {
- if (this.field_0 != null) {
- this.field_0.stop();
- this.field_0 = null;
- }
-
- }
-
- public void run() {
- ((Applet)this).showStatus("");
- ((Component)this).show();
- this.field_8 = ((Component)this).size().width;
- this.field_9 = ((Component)this).size().height;
- if (!this.whb) {
- for(this.field_10 = 1; this.field_10 <= this.text_count; ++this.field_10) {
- if (this.infostr != null) {
- if (this.infostr.equals("Applet by Gokhan Dagli,japplets.tripod.com")) {
- this.field_1[this.field_10] = ((Applet)this).getParameter("text" + this.field_10);
- } else {
- this.field_1[this.field_10] = "Warning ! info parameter error!";
- }
- } else {
- this.field_1[this.field_10] = "Warning ! info parameter error!";
- }
-
- try {
- this.field_4[this.field_10] = Integer.parseInt(((Applet)this).getParameter("textcolor" + this.field_10), 16);
- } catch (Exception var5) {
- this.field_4[this.field_10] = 0;
- }
-
- this.field_3[this.field_10] = new Color(this.field_4[this.field_10]);
- this.field_2[this.field_10] = ((Applet)this).getParameter("direction" + this.field_10);
-
- try {
- this.field_6[this.field_10] = Integer.parseInt(((Applet)this).getParameter("wait_period" + this.field_10), 10);
- } catch (Exception var4) {
- this.field_6[this.field_10] = 2;
- }
-
- try {
- this.animation_step[this.field_10] = Integer.parseInt(((Applet)this).getParameter("animation_step" + this.field_10), 10);
- } catch (Exception var3) {
- this.animation_step[this.field_10] = 2;
- }
-
- try {
- this.field_5[this.field_10] = new Font(((Applet)this).getParameter("font_type" + this.field_10), Integer.valueOf(((Applet)this).getParameter("font_style" + this.field_10)), Integer.valueOf(((Applet)this).getParameter("font_size" + this.field_10)));
- } catch (Exception var2) {
- this.field_5[this.field_10] = new Font("Arial", 0, 9);
- }
-
- this.fmetrics = ((Component)this).getFontMetrics(this.field_5[this.field_10]);
- this.mesajgenisligi[this.field_10] = this.fmetrics.stringWidth(this.field_1[this.field_10]);
- this.descdata[this.field_10] = this.fmetrics.getDescent();
- this.txth[this.field_10] = this.fmetrics.getDescent() + this.fmetrics.getAscent();
- this.aralik[this.field_10] = (this.field_9 - this.txth[this.field_10]) / 2;
- if (this.field_2[this.field_10].equals("true")) {
- this.field_11[this.field_10] = this.field_8;
- } else {
- this.field_11[this.field_10] = -1 * this.mesajgenisligi[this.field_10];
- }
-
- this.controld[this.field_10] = 0;
- }
-
- this.img = ((Component)this).createImage(this.field_8, this.field_9);
- this.field_7 = this.img.getGraphics();
- this.field_7.setColor(this.bgc);
- this.field_7.fillRect(0, 0, this.field_8, this.field_9);
- }
-
- this.whb = true;
-
- while(true) {
- try {
- Thread.sleep(this.hiz);
- } catch (InterruptedException var1) {
- }
-
- ((Component)this).repaint();
- }
- }
- }
-